<template>
  <div v-if="isAdmin">
      <el-badge :value="notification" :max="99" :hidden="hidden">
        <i class="el-icon-bell" @click="goToRecord"></i>
      </el-badge>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
export default {
  name: 'Notification',
  data() {
    return {
    }
  },
  computed: {
    ...mapGetters([
      'role',
      'notification',
    ]),
    isAdmin(){
      return this.role == 'Admin'
    },
    hidden(){
      return this.notification == 0
    }
  },
  methods: {
    goToRecord(){
      this.$router.push('/record/index')
    },
  }
}
</script>

<style lang="scss" scoped>

</style>
